package book;

import user.User;

public class PariOfUidAndBookId {
    private int UserId;
    private int BookId;

    public PariOfUidAndBookId() {

    }

    public PariOfUidAndBookId(int userId, int bookId) {
        UserId = userId;
        BookId = bookId;
    }

    //get方法
    public int getUserId() {
        return UserId;
    }

    public int getBookId() {
        return BookId;
    }

    //set方法
    public void setUserId(int userId) {
        UserId = userId;
    }

    public void setBookId(int bookId) {
        BookId = bookId;
    }

    @Override
    public String toString() {
        return "PariOfUidAndBookId{" +
                "UserId=" + UserId +
                ", BookId=" + BookId +
                '}';
    }

    //toJon方法：对象转变为字符串
    public String toJon(){
        //1.拼接
        StringBuilder toJON = new StringBuilder();
        toJON.append(UserId).append(",");
        toJON.append(BookId);
        //2.返回
        return toJON.toString();
    }
}
